# 1.打印商品列表
products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffe",31],["Book",60],["Nike",699]]
print("{:-^20}".format('  商品列表  '))
for i in range(len(products)):
    print(products[i][0],products[i][1], sep ='\t')


# 2. 购物车功能
shop_cart, shop_cost, products_list = set(), set(), set()
products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffe",31],["Book",60],["Nike",699]]
for i in range(len(products)):
    products_list.add(products[i][0])
while True:
    item = input('item:')
    if item in products_list:
       shop_cart.add(item)
    elif item not in products_list and item != 'q':   
        print('No products')            
    if item == 'q':
       break
shop_cost = shop_cart
print(shop_cost)
